package list.p3_singlelist;

public class Test {
    public static void main(String[] args) {
//        test1();
//        test2();
        test3();
    }

    private static void test1() {
        MySingleList list = new MySingleList();
        list.addFirst(1);
        list.addFirst(2);
        list.addLast(4);
        list.addLast(5);
        list.addLast(4);
        list.addFirst(3);
        System.out.println(list);
//        list.reverse();
//        System.out.println(list);
        System.out.println(list.getLastK(2));
        System.out.println(list.getLastK(1));
        System.out.println(list.getLastK(6));
        System.out.println(list.getLastK(7));
    }

    private static void test3() {
        MySingleListWithoutHead list = new MySingleListWithoutHead();
        list.addLast(1);
        list.addLast(2);
        list.addLast(4);
        list.addLast(5);
        list.addLast(2);
        list.addLast(3);
        list.split(list, 3);
        list.display();
    }

    private static void test2() {
        MySingleListWithoutHead list = new MySingleListWithoutHead();
        list.addFirst(3);
        list.addFirst(5);
        list.addFirst(3);
        list.addLast(1);
        list.addLast(1);
        list.addLast(2);
        list.addLast(2);
        list.addIndex(2, 4);
        list.display();
        list.remove(3);
        list.removeAllKey(1);
        list.display();
        System.out.println(list.size());
        list.clear();
        System.out.println(list.size());
    }
}
